Introducing a date and time (day, mounth, year, hours, minutes, seconds) the VC10MkTime function gives the number of seconds elapsed from 00:00 of the 1 January 1970 until the introduced date.
This is useful to be able to make comparisons between dates.
The function also runs day and month values greater than its natural limits (day > 31 or mounth > 12), automatically calculating the date.
VC10MkTime (aglParam, glSumSec)
Parametri:
| IN/OUT | TIPO VARIABILE | NOME DI ESEMPIO | DIM | |
|---|---|---|---|---|
| IN | ARRGBL | aglParam[01] | L | Giorno [>0] |
| IN | ARRGBL | aglParam[02] | L | Mese [>0] |
| IN | ARRGBL | aglParam[03] | L | Anno [1970÷2037] |
| IN | ARRGBL | aglParam[04] | L | Ora [0÷23] |
| IN | ARRGBL | aglParam[05] | L | Minuti [0÷59] |
| IN | ARRGBL | aglParam[06] | L | Secondi [0÷59] |
| OUT | ARRGBL | aglParam[07] | L | Giorno della settimana: 0 = domenica 1 = lunedì 2 = martedì 3 = mercoledì 4 = giovedì 5 = venerdì 6 = sabato |
| OUT | ARRGBL | aglParam[08] | L | Numero di giorni passati rispetto al 1° gennaio dell'anno introdotto |
| OUT | ARRGBL | aglParam[09] | L | Tipo di Errore: 0 = Nessuno 1 = Giorno ≤ 0 2 = Mese ≤ 0 3 = Anno introdotto fuori limiti [1970÷2037] |
| OUT | GLOBAL | glSumSec | L | Somma dei secondi trascorsi dalle 00:00 del 1°gennaio 1970 fino alla data introdotta |
Si vuole attivare una uscita digitale (ofUscita01) quando la data e l'ora attuale supera una data e un'ora impostata precedentemente.
;Data Attuale aglParam[1] = 25 aglParam[2] = 6 aglParam[3] = 2009 aglParam[4] = 15 aglParam[5] = 30 aglParam[6] = 55 VC10MkTime (aglParam, glSumSec) glSecActual = glSumSec ;Valore in secondi della data attuale ;Data da confrontare aglParam[1] = 1 aglParam[2] = 1 aglParam[3] = 2010 aglParam[4] = 18 aglParam[5] = 00 aglParam[6] = 00 VC10MkTime (aglParam, glSumSec) glSecExpiry = glSumSec ;Valore in secondi della data di scadenza IF glSecActual GT glSecExpiry SETOUT ofUscita01 ENDIF